/**
 * Copyright 2008 Wink Saville
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License version 3
 * as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

/* Only one allowed */
if (typeof McId == "undefined")
{
    /**
     * Constructor for McId
     */
    function McId()
    {
        this.name = null;
        this.ipAddr = null;
        this.ipPort = 0;
        this.id = 0;
        this.remoteId = 0;
        this.remote = false;
    }
    McId.SERDES_ID = 3;
    
    function _deser(jo) {
        var mcid = new McId();
        mcid.name = jo[0];
        mcid.ipAddr = jo[1];
        mcid.ipPort = jo[2];
        mcid.id = jo[3];
        mcid.remoteId = jo[4];
        mcid.remote = jo[5];
        return mcid;
    }
    Deserializer.register(McId.SERDES_ID, _deser);
    
    McId.prototype.toJSONString = function() {
        return "{ \"" + McId.SERDES_ID + "\":["
         + stringToJSON(this.name) + ","
         + stringToJSON(this.ipAddr) + ","
         + this.ipPort + ","
         + this.id + ","
         + this.remoteId + ","
         + this.remote
         + "]}"
    }
}
